package com.example.saas.context;

/**
 * 数据源上下文
 */
public class DataSourceContext {

    private final static ThreadLocal<String> DATASOURCEKEY = new ThreadLocal<>();

    public static void setDataSourceKey(String dataSourceKey) {
        DATASOURCEKEY.set(dataSourceKey);
    }

    public static String getDataSourceKey() {
        return DATASOURCEKEY.get();
    }

    public static void clearDataSourceKey() {
        DATASOURCEKEY.remove();
    }
}
